package cn.edu.xmu.orderpayment.order.model.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Chencheng Liao 22920192204238
 * @date 2021/12/28
 */
public enum RegionState {
    USABLE(0, "有效"),
    STOPPED(1, "停发"),
    CANCELED(2, "废弃");

    private static final Map<Integer, RegionState> REGION_STATE_MAP;
    static {
        REGION_STATE_MAP = new HashMap();
        for (RegionState enum1 : values()) {
            REGION_STATE_MAP.put(enum1.code, enum1);
        }
    }
    private int code;
    private String description;
    RegionState(int code, String description) {
        this.code = code;
        this.description = description;
    }
    public static RegionState getRegionStateByCode(Integer code) {
        return REGION_STATE_MAP.get(code);
    }
    public Integer getCode() {
        return code;
    }
    public String getDescription() {
        return description;
    }
}
